

# 键盘输入行向
row_number = eval(input("请输入菱形的行数: "))
while row_number%2==0:
    print("请重新输入行数")
    row_number = eval(input("请输入菱形的行数: "))

# 上半部分的行数
top_row=(row_number+1)//2
for i in range(1, top_row+1):
    for j in range(1, top_row+1-i):
        print(" ", end='')
    for k in range(1, 2*i):    # 1~2,1~4
        print("*", end='')     # 输出内容为空的时候换行
    print()

# 下半部分
bottom_row=row_number//2
for i in range(1, bottom_row+1):
    # 直角三角形
    for j in range(1, i+1):
        print(" ", end='')
    # 倒三角
    for k in range(1, 2*bottom_row-2*i+2):
        print("*", end='')
    print()




